from datetime import date, timedelta

def get_last_day_of_previous_month():
    today = date.today()

    first_day_of_current_month = today.replace(day=1)
    last_day_of_previous_month = first_day_of_current_month - timedelta(days=1)
    return last_day_of_previous_month

def get_first_day_of_previous_month():
    today = date.today()

    first_day_of_current_month = today.replace(day=1)
    last_day_of_previous_month = first_day_of_current_month - timedelta(days=1)
    first_day_of_previous_month = last_day_of_previous_month.replace(day=1)
    return first_day_of_previous_month

def get_begin_date(end_date):
    begin_date = end_date.replace(day=1)
    return begin_date